import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

    public class Lowmoney_FlowBean implements WritableComparable<Lowmoney_FlowBean> {
        private long require_nums;
        private long end_date;
         private  String ass;



        public String getAss() {
            return ass;
        }

        public void setAss(String ass) {
            this.ass = ass;
        }

        public long getRequire_nums() {
            return require_nums;
        }




        public Lowmoney_FlowBean() {
            super();
        }


        @Override
        public int compareTo(Lowmoney_FlowBean bean) {
            int result;
            if (end_date > bean.getEnd_date()) {
                result = -1;
            } else if (end_date < bean.getEnd_date()) {
                result = 1;
            } else {
                result = 0;
            }
            return result;
        }

        @Override
        public void write(DataOutput out) throws IOException {
            out.writeLong(require_nums);
            out.writeLong(end_date);
            out.writeUTF(ass);

        }

        @Override
        public void readFields(DataInput in) throws IOException {
            require_nums = in.readLong();
            end_date = in.readLong();
            ass = in.readUTF();
        }

        public long getEnd_date() {
            return end_date;
        }

        public void setEnd_date(long end_date) {
            this.end_date = end_date;
        }


        public void setRequire_nums(long require_nums) {
            this.require_nums = require_nums;
        }
        @Override
        public String toString() {
            return ass+ "\t" +require_nums + "\t" + end_date ;
        }
    }

